package com.woniu.serviceorder.generator;



import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 自动生成代码工具类
 */
public class MysqlGenerator {
    public static void main(String[] args) {

        FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-order?characterEncoding=utf-8&serverTimezone=GMT%2B8",
                        "root", "239611")
                .globalConfig(builder -> {
                    builder.author("lpc")
                            .outputDir("D:\\1CodeRepositories\\online-taxi-back\\service-order\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.woniu.serviceorder")
                            .pathInfo(Collections.singletonMap(OutputFile.xml,
                                    "D:\\1CodeRepositories\\online-taxi-back\\service-order\\src\\main\\resources\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("driver_order_statistics");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();

    }
}
